<#include "../common/common.ftl">
<#include "../common/window.ftl">
<!--取出window对象-->
<#assign windowId = req.getAttribute("jwas_single_window_id")>
<#assign window = session.getAttribute(windowId)>
<#assign multiWindow = session["jwas_multi_window_id"]>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<base href="${basePath}">
<title>${multiWindow.desc}</title>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<link rel="StyleSheet" href="cep/css/cep.css" type="text/css"/>
</head>
<script type="text/javascript" src="cep/js/mootools/mootools_hash.js"></script>
<script type="text/javascript" src="FCKeditor/fckeditor.js"></script>
<script type="text/javascript" src="cep/js/validation/validation.js"></script>
<script type="text/javascript" src="cep/js/validation/form_auto_validation.js"></script>
<script type="text/javascript" src="cep/js/sort.js"></script>
  <script type="text/javascript">
  	var pri_sec = new Hash();
  	<#list multiWindow.relations?keys as key>
  	pri_sec.set("${key}","${multiWindow.relations[key]}");
  	</#list>
  	function reloadSecondary(){
  		var relationKeys = pri_sec.keys();
  		var url = "1";
  		for(var i = 0;i<relationKeys.length;i++){
  			var akey = relationKeys[i];
  			var priValue = eval("easymana_form." + akey + ".value");
  			var secField = pri_sec.get(akey);
  			if(url == "1") url = secField + "=" + priValue;
  			else url = url + "&" + secField + "=" + priValue;
  		}
  		url = "window.was?id=${multiWindow.secondary}&" + url;
  		var frm = $("iframe_secondary");
  		frm.src=url;
  	}
  </script>
  <body>
  <b>${window.desc?string}</b><span style="padding-left:50px;color: #700700" id="easy_mana_err_span">${message?if_exists}<font color="red"> ${err_msg?if_exists}</font></span>
<#if !(window?exists)>
	no window
<#else>
   	<!-- 显示表属性，并且以表单形式呈现 -->
   	<#assign rowNum=window.dispCol>
   	<#assign rowNum = rowNum?int>
	<form name="form_jump_page" method="${window.method}" action="${window.action}">
	<INPUT type="hidden" name="action" value="topage" />
	<INPUT type="hidden" name="toPage" value=""/>
	</form>
	<FORM name="${window.formName}" method= "${window.method}" action="${window.action}">
	<INPUT type="hidden" name="jwas_single_window_id" value="${jwas_single_window_id}"/>
	<TABLE width="100%">
	<#assign posi=-1>
	<@output_fields window.fields/>
	<!-- 操作按纽 -->
	<tr><td colspan="4">
	<#if window.methods?exists>
		<@output_methods window.methods/>
	</#if>
	</td></tr>
	</TABLE>
	</FORM>
</#if>
<hr>
<#assign tableSessionName="window_${window.id}">
<#if req.getAttribute(tableSessionName)?exists>
    <#assign dtable=req.getAttribute(tableSessionName)/>
    <!-- 打印表格 -->
    <@output_win_table dtable/>
</#if>
<div id="display" class="display"></div>
<script type="text/javascript" src="cep/js/window.js"></script>
<script type="text/javascript" src="cep/js/window_copy_pri.js"></script>
<script language="javascript">
	setTableId("${dtable.id?if_exists}");
	setFormName("${window.formName}");
</script>
<br/>
<iframe src="window.was?id=${multiWindow.secondary}" id="iframe_secondary" name="secondary" frameborder="0" width="100%" height="570"></iframe>
</body>
</html>